team join spectator @s[team=]
gamemode spectator @s[team=spectator,gamemode=!spectator]
gamemode adventure @s[team=!spectator]
execute as @s[team=red] at @s run tp @s @e[type=marker,tag=redSpawn,limit=1]
execute as @s[team=blue] at @s run tp @s @e[type=marker,tag=blueSpawn,limit=1]
execute as @s[team=red] at @s run tp @s ~ ~ ~ 0 0
execute as @s[team=blue] at @s run tp @s ~ ~ ~ 180 0
tp @s[team=spectator] @r[team=!spectator]
tag @s add playing
clear @s *
function vs:system/game/get_baseitem